<template>
    <div class="setModal" v-show="isShow">
        <div class="pulsesFrame">
            <div class="close" @click="isShow = false">
                <i class="el-icon-circle-close"></i>
            </div>
            <div class="content">
                <div class="pulsesVal">
                    <span style="font-size:18px;font-weight:650;color:#fff;padding-right:15px">每脉冲产出数:</span>
                    <el-input-number v-model="numberPulses" controls-position="right" :min="0" size="small"
                        :controls="false"></el-input-number>
                </div>
                <el-button type="primary" @click="handleEvent(0)">确定</el-button>
            </div>
            <div class="recalculate">
                <i class="el-icon-refresh-right"></i>
                <span style="font-size:18px;font-weight:650;padding-left:5px" @click="handleEvent(1)">重新计数</span>
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        data() {
            return {
                numberPulses: 0,
                isShow: false
            }
        },
        methods: {
            open(numberPulses) {
                this.numberPulses = numberPulses
                this.isShow = true
            },
            handleEvent(type) {
                this.$emit('handlePulses', this.numberPulses,type)
                this.isShow = false
            },
        }
    }
</script>

<style lang="less" scoped>
    .setModal {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        right: 0;
        background-color: rgba(47, 79, 79, .5);
    }
    .pulsesFrame {
        position: absolute;
        width: 460px;
        height: 260px;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        background-color: #302c2c;
        box-shadow: 0 0 50px #9b9999;

        .close {
            position: absolute;
            right: 15px;
            top: 15px;
        }

        .recalculate {
            position: absolute;
            left: 30px;
            bottom: 15px;
            display: flex;
            align-items: center;
        }

        .close,
        .recalculate {
            font-size: 35px;
            color: #fff;
            cursor: pointer;
        }

        .content {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100%;

            .pulsesVal {
                padding-bottom: 40px;

                ::v-deep .el-input-number.is-without-controls .el-input__inner {
                    font-size: 20px;
                }
            }

            ::v-deep .el-button {
                background-color: #124e6c;
                border-color: #124e6c;
                padding: 10px 35px;

                span {
                    margin-left: 0;
                }
            }
        }
    }
</style>